﻿<Common:LayoutAwarePage x:Class="WinRTClient.MainPage"
                        IsTabStop="false"
                        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                        xmlns:local="using:WinRTClient"
                        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
                        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
                        xmlns:View="using:StyleMVVM.View"
                        xmlns:Common="using:WinRTClient.Common"
                        xmlns:DesignData="using:dot_in.HTWKAidStation.Client.DesignData"
                        View:ViewModel.Name="MainPageViewModel"
                        mc:Ignorable="d">
    <Grid Style="{StaticResource LayoutRootStyle}">
        <Grid.RowDefinitions>
            <RowDefinition Height="140" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>
        <Grid>
            <TextBlock x:Name="pageTitle"
                       Text="HTWK Aid Station"
                       Style="{StaticResource PageHeaderTextStyle}"
                       Margin="120,0,30,40" />
        </Grid>
        <Grid Grid.Row="1">
            <StackPanel VerticalAlignment="Top"
                        Orientation="Horizontal">
                <StackPanel Height="700"
                            Margin="20,8">
                    <TextBlock Text="Speiseplan"
                               Style="{StaticResource HeaderTextStyle}"
                               Margin="0,0,0,20" />
                    <ComboBox ItemsSource="{Binding Mensae}"
                              SelectedItem="{Binding SelectedMensa, Mode=TwoWay}"
                              Width="300" />
                    <Button Content="Speiseplan anzeigen"
                            Command="{Binding ShowMenuCommand}" />
                </StackPanel>
                <StackPanel Height="700"
                            Margin="20,8">
                    <TextBlock Text="Stundenplan"
                               Style="{StaticResource HeaderTextStyle}"
                               Margin="0,0,0,20" />
                    <TextBlock Text="Fakultät:"
                               Style="{StaticResource TitleTextStyle}"
                               Margin="0,-10,0,5" />
                    <GridView ItemsSource="{Binding Faculties}"
                              SelectionMode="None"
                              IsItemClickEnabled="True"
                              View:AttachedEventCommand.Event="ItemClick"
                              View:AttachedEventCommand.Command="{Binding FacultyClick}">
                        <GridView.ItemTemplate>
                            <DataTemplate>
                                <Border BorderBrush="LightGray"
                                        Background="#87FF5E5E"
                                        Height="55"
                                        Width="230"
                                        BorderThickness="1"
                                        VerticalAlignment="Stretch"
                                        HorizontalAlignment="Stretch">
                                    <TextBlock Margin="10,3"
                                               VerticalAlignment="Center"
                                               HorizontalAlignment="Center"
                                               TextWrapping="Wrap"
                                               TextAlignment="Center"
                                               Text="{Binding}" />
                                </Border>
                            </DataTemplate>
                        </GridView.ItemTemplate>
                        <GridView.ItemsPanel>
                            <ItemsPanelTemplate>
                                <VariableSizedWrapGrid Orientation="Horizontal"
                                                       MaximumRowsOrColumns="2" />
                            </ItemsPanelTemplate>
                        </GridView.ItemsPanel>
                    </GridView>
                    <TextBlock Text="Studiengang:"
                               Style="{StaticResource TitleTextStyle}"
                               Margin="0,-10,0,5" />
                    <ComboBox Margin="8,0,0,0"
                              ItemsSource="{Binding SelectedFaculty.Courses}"
                              SelectedItem="{Binding SelectedCourse,Mode=TwoWay}" />
                    <TextBlock Text="Seminargruppe:"
                               Style="{StaticResource TitleTextStyle}"
                               Margin="0,0,0,5" />
                    <ComboBox Margin="8,0,0,0"
                              ItemsSource="{Binding SelectedCourse.TutorialGroups}"
                              SelectedItem="{Binding SelectedTutorialGroup, Mode=TwoWay}" />
                    <TextBlock Text="Planungswoche:"
                               Style="{StaticResource TitleTextStyle}"
                               Margin="0,0,0,5" />
                    <ComboBox Margin="8,0,0,0"
                              ItemsSource="{Binding Weeks}"
                              SelectedItem="{Binding SelectedWeek, Mode=TwoWay}" />
                    <Button Content="Stundenplan anzeigen"
                            HorizontalAlignment="Center"
                            Margin="0,12,0,0"
                            Command="{Binding ShowTimetableCommand}" />
                </StackPanel>
            </StackPanel>
        </Grid>
    </Grid>
</Common:LayoutAwarePage>
